//
//  JwRootViewController.m
//  JwPack
//
//  Created by 陈警卫 on 2022/8/30.
//

#import "JwRootViewController.h"

@interface JwRootViewController ()

@end

@implementation JwRootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

/// 设置navTab视图
+ (JwRootViewController *)rootWithTabBarModels:(NSArray *)tabBarModels {
    JwTabBarController *tc = [[JwTabBarController alloc] init];
    [tc setupViewControllers:tabBarModels];
    JwRootViewController *rc = [[JwRootViewController alloc] initWithRootViewController:tc];
    return rc;
}

/// 设置navTab视图
+ (JwRootViewController *)rootWithTabBarVc:(JwTabBarController *)tc {
    JwRootViewController *rc = [[JwRootViewController alloc] initWithRootViewController:tc];
    return rc;
}

/// 设置主视图
+ (JwRootViewController *)showWithViewController:(UIViewController *)vc {
    JwRootViewController *rc = [[JwRootViewController alloc] initWithRootViewController:vc];
    return rc;
}

// 监听暗黑切换
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
    [super traitCollectionDidChange:previousTraitCollection];
    
    /**
     if (kJwPackConfig.jw_isFollowSystemDark) {
     if (@available(iOS 13.0, *)) {
     if ([UITraitCollection currentTraitCollection].userInterfaceStyle == UIUserInterfaceStyleLight) {
     [kJwPackConfig jw_setupThemeIndex:0];
     } else if ([UITraitCollection currentTraitCollection].userInterfaceStyle == UIUserInterfaceStyleDark) {
     [kJwPackConfig jw_setupThemeIndex:1];
     } else {
     [kJwPackConfig jw_setupThemeIndex:0];
     }
     }
     }
     */
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
